{layout name="public:layout" /}

<h4 class="text-center text-success">文章管理</h4>
<table class="table table-default table-hover text-center">
    <tr>
        <td>ID</td>
        <td>标题</td>
        <td>栏目</td>
        {eq name="$Think.session.admin_level" value="1"}
        <td>作者</td>
        {/eq}
        <td>阅读量</td>
        <td>创发布时间</td>
        <td colspan="2">操作</td>
    </tr>

    {volist name="artList" id="art" empty="$empty"}
    <tr>
        <td>{$art.id}</td>
        <td>{$art.title}</td>
        <td>{$art.cate_id|getCateName}</td>
        {eq name="$Think.session.admin_level" value="1"}
        <td>{$art.user_id|getUserName}</td>
        {/eq}
        <td>{$art.pv}</td>
        <td>{$art.create_time|date="Y-m-d"}</td>
        <td><a href="{:url('article/artEdit',['id'=>$art.id])}">编辑</a> </td>
        <td><a href="{:url('admin/article/doDelete',['id'=>$art.id])}" onclick="dele(event)">删除</a></td>
    </tr>
    {/volist}
</table>

<div class="text-center">
    {$artList|raw}
</div>
<script>
    function dele(event) {
        if (confirm('确定删除吗')==true){
        }else {
            //阻止a连接生效
            event.preventDefault();
        }
    }

</script>